using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._EditingTools
{
    /// <summary>
    /// <para>Extend Line</para>
    /// <para>Extends line segments to the first intersecting feature within a specified distance. If no intersecting feature is within the specified distance, the line segment will not be extended. Tool use is intended for quality control tasks such as cleaning up topology errors in features that were digitized without having set proper snapping environments.</para>
    /// <para>将线段延伸到指定距离内的第一个相交要素。如果指定距离内没有相交要素，则不会延长线段。工具用于质量控制任务，例如清理未设置适当捕捉环境的数字化要素中的拓扑错误。</para>
    /// </summary>    
    [DisplayName("Extend Line")]
    public class ExtendLine : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtendLine()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input Features</para>
        /// <para>The line input features to be extended.</para>
        /// <para>要扩展的线路输入功能。</para>
        /// </param>
        public ExtendLine(object _in_features)
        {
            this._in_features = _in_features;
        }
        public override string ToolboxName => "Editing Tools";

        public override string ToolName => "Extend Line";

        public override string CallName => "edit.ExtendLine";

        public override List<string> AcceptEnvironments => ["extent", "workspace"];

        public override object[] ParameterInfo => [_in_features, _length, _extend_to.GetGPValue(), _out_feature_class];

        /// <summary>
        /// <para>Input Features</para>
        /// <para>The line input features to be extended.</para>
        /// <para>要扩展的线路输入功能。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Extend Length</para>
        /// <para>The maximum distance a line segment can be extended to an intersecting feature.</para>
        /// <para>线段可延伸至相交要素的最大距离。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extend Length")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public string? _length { get; set; } = null;


        /// <summary>
        /// <para>Extend to Extensions</para>
        /// <para><xdoc>
        ///   <para>Specifies whether line segments can be extended to other extended line segments within the specified extend length.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Line segments can be extended to other extended line segments as well as existing line features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Line segments can only be extended to existing line features.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否可以将线段延伸到指定延伸长度内的其他延伸线段。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 线段可延伸至其它延伸线段以及现有线要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>未选中 - 线段只能扩展到现有线要素。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Extend to Extensions")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _extend_to_value _extend_to { get; set; } = _extend_to_value._true;

        public enum _extend_to_value
        {
            /// <summary>
            /// <para>EXTENSION</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("EXTENSION")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>FEATURE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("FEATURE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Updated Input Features</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Updated Input Features")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _out_feature_class { get; set; }


        public ExtendLine SetEnv(object extent = null, object workspace = null)
        {
            base.SetEnv(extent: extent, workspace: workspace);
            return this;
        }

    }

}